<template>
	<view class="content">
		<view  class="title" v-for="(item,index) in data" :key='index' @click="detail(item)">
			{{++index}}、{{item.title}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				data: []
			}
		},
		onShow() {
			this.$myRequest({
				url: '/question',
				method: 'get'
			}).then(res => {
				// console.log(res)
				this.data = res.data
			})
		},
		methods: {
			detail(e) {
				uni.setStorage({
					key:'item',
					data:e
				})
				uni.navigateTo({
					url:'../detail/detail'
				})
			}
		}
	}
</script>

<style style="lang" scoped>
	.title {
		padding: 20rpx;
		border-bottom: 1rpx solid #ccc;
	}
</style>
